package com.nopay.cdxphone.dialog;

import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.nopay.cdxphone.R;


/**
 * 1个输入框
 */
public class DialogSettingSim extends Dialog {

    private Activity mActivity;
    private EditText et;
    private int mType = 1;

    public DialogSettingSim(@NonNull Activity context, int type) {
        super(context, R.style.MyDialog);
        mActivity = context;
        mType = type;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_sim_number);
        //按空白处不能取消动画
        setCanceledOnTouchOutside(true);
        TextView tvTitle = findViewById(R.id.tv_title);
        et = findViewById(R.id.et_dialog_oneinput_onechoose_two_right);
        if (mType == 1){
            tvTitle.setText("输入SIM卡1号码");
            et.setHint("输入SIM卡1号码");
        }else if(mType == 2){
            tvTitle.setText("输入SIM卡2号码");
            et.setHint("输入SIM卡2号码");
        }

        findViewById(R.id.tv_dialog_oneinput_onechoose_close).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
        findViewById(R.id.tv_dialog_oneinput_onechoose_search).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dealContent(DialogSettingSim.this,
                        et.getText().toString().trim(), mType);
                dismiss();
            }
        });
    }

    public void dealContent(Dialog dialog, String one, int type) {

    }

}



